﻿using System.Data.Entity.ModelConfiguration;
namespace wh40klbModel.ModelConfiguration
{
    class ArmySquadTypeUsedConfiguration : EntityTypeConfiguration<ArmySquadTypeUsed>
    {
        public ArmySquadTypeUsedConfiguration()
        {
            //Cle Primaire et table
            HasKey(astu => new { astu.ArmyId, astu.SquadTypeId });
            //Propriete
            Property(astu => astu.nbMaximum).IsRequired();
            Property(astu => astu.nbMinimum).IsOptional();
            //cle etrangere
            HasRequired(astu => astu.Army).WithMany(a => a.ArmySquadTypeUseds);
            HasRequired(astu => astu.SquadType).WithMany(st => st.ArmySquadTypeUseds);





        }
    }
}
